fix(types): resolve remaining mypy errors missed by #1253#1296
Conversation
Suppresses no-any-return in providers and factory, fixes Optional defaults in database.py, adds type: ignore for file_watcher redefs, casts TransitionStatus in checkpoint_bridge.
…faults - checkpoint_bridge.py: add `from typing import cast` and CheckpointStatus import - factory.py: suppress no-any-return on dynamic provider instantiation - claude.py: fix vision() to materialize Iterator[str] before returning - database.py: fix update_session Optional defaults, create_session return type
PathValidator.create_backup() creates timestamped backups like file.YYYYMMDD_HHMMSS.bak.py, not file.py.bak. The assertion was checking the wrong path, causing a flaky failure.
…up test - database.py: fix all Optional defaults in add_message/update_session, fix return types for add_document/add_message, type params list as Any - test_code_agent.py: fix second backup assertion in integration test
- database/mixin.py: add assert narrowing after _require_db() - device.py: cast registry value to str - installer/mcp_init.py: annotate config_data dict - rag/pdf_utils.py: annotate positions list - testing/mocks.py: wrap return in dict() - ui/database.py: fix Optional defaults in update_document_status, get_setting - test_code_agent.py: fix second backup assertion in integration test
- connectors/store.py: suppress no-any-return on sqlite row returns - api/app.py: use set comprehension for pids (was list assigned to set) - validation_parsing.py: suppress attr-defined for mixin attributes - checklist_generator.py: suppress no-any-return on dict.get returns - session.py: suppress dict-item on error return branch - tools.py: annotate _TOOL_REGISTRY, fix Optional func parameter
…l defaults - tools.py: suppress no-any-return and return-value on get_tool_description - memory_store.py: bulk fix str = None -> str | None = None across all methods
|
The type-annotation cleanup work here is correct and systematic — the Issues🟡 Duplicate return statement — claude.py and openai_provider.pyBoth LLM provider files now contain two back-to-back identical
Neither causes a runtime failure (the second 🟡 Duplicate import — checkpoint_bridge.py:13-15
🟢 Two
|
# Conflicts: # src/gaia/governance/checkpoint_bridge.py
|
One critical edit error slipped into an otherwise clean mypy sweep: both LLM provider files now contain duplicate back-to-back Issues🔴 Duplicate
|
|
Correct, well-scoped fix that unblocks CI for five open PRs. Almost all changes are straightforward Issues🟡
|
PR #1253 fixed the first batch of mypy errors but missed 12 more that surface when the full codebase is linted. These are blocking CI on all open PRs (#1243, #1244, #1245, #1248, #1249). Once this merges and the open PRs rebase, their lint checks will pass.
Test plan
python util/lint.py --allpasses with 0 mypy errors